package com.mtsmda.test;

public class OperatorPreoritets {

	public static void main(String[] args) {
		// int result = 12 + 2 * 5 % 3 - 15 / 4;// 12 + 10 % 3 - 3 //
		int result = 12 + ((2 * 5) % 3) - (15 / 4);// 12 + 10 % 3 - 3 //
		System.out.println(result);
		System.out.println(0 / 3);
		System.out.println(0.00 / 3);
		System.out.println("-----");
		int c = 9;
		c = (c++ + c) + (c-- - c--) + ++c;// 9 + 10 + 10 - 9 + 9
		System.out.println(c + " - " + (9 + 10 + 10 - 9 + 9));
		int g = 0;
		g = g-- - ++g + g++ - --g + g-- + g++ - --g;
		// 0 - 0 + 0 - 0 + 0 + 0 - 0;
		System.out.println(g + " " + (0 - 0 + 0 - 0 + 0 + 0 - 0));
		System.out.println("-----");
		o1();
		System.out.println("-----");

		// double
		double dc = 15.5 % 1.5;
		System.out.println(dc);

		final int integ = 15;
		// int v = integ++;
		System.out.println(integ);
		System.out.println("-----");
		o2();
		System.out.println("-----");
		if (((5 & 6) == 9)) {
			System.out.println(((5 & 6) == 9));
		} else {
			System.out.println(((5 & 6) == 9));
		}
		// System.out.println("s" + (5 && 6));
		System.out.println("s" + (5 & 6));
		System.out.println("s" + (5 | 6));
		System.out.println("-----");
		o3();
		System.out.println("-----");
		System.out.println("-----");

	}

	private static void o1() {
		int f;
		f = 5;
		f = ++f + f++;
		System.out.println(f);
	}

	private static void o2() {
		boolean b1 = true, b2 = false;
		boolean b3 = (b1 == true) && (b2 = true);
		System.out.println(b1 + " " + b3);
	}

	private static void o3() {
		/*int i = 1;
		long j = 1;
		if (i == 1) {
			int k = 1;
			if (i == k) {
				System.out.println("i equals k");
			}
		} else if (j == k) {
			System.out.println("j equals k");
		}*/
	}

}